package com.ruoyi.robot.handler;
import com.auth0.jwt.exceptions.AlgorithmMismatchException;
import com.auth0.jwt.exceptions.SignatureVerificationException;
import com.auth0.jwt.exceptions.TokenExpiredException;
import com.ruoyi.common.core.domain.AjaxResult;
import io.jsonwebtoken.SignatureException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 功能描述：
 *
 * @Author：yid
 * @Date：2022/1/17 20:16
 */

@RestControllerAdvice
public class PermissionHandler {

    @ExceptionHandler(value = {SignatureException.class})
    @ResponseBody
    public AjaxResult authorizationException(SignatureException e){
        return AjaxResult.error(e.getMessage(),null);
    }
}
